package inits

import (
	"api-gitway/untils"
	"log"
)

func Init() {
	InitConsul()
}
func InitConsul() {
	client, err := untils.NewConsulClient("14.103.149.197", 8500)
	if err != nil {
		return
	}
	register := untils.ConsulRegister{
		Id:      "zx",
		Name:    "api-gitway",
		Tags:    []string{"api-gitway"},
		Address: "localhost",
		Port:    8800,
	}
	err = client.Register(register)
	if err != nil {
		panic(err)
	}
	log.Println("init consul success")
}
